package com.common.help.test08;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;

public class Socket1 {

	public static void main(String[] args) throws IOException {
		
		InetAddress addr = InetAddress.getByName("127.0.0.1");
		Socket socket = new Socket(addr,ServerSocket1.port);
		PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())));
		for(int i=0;i<10;i++){
			pw.println("hello--"+i);
		}
		pw.println("END");
		pw.flush();
		socket.shutdownOutput();//重点
		socket.close();
		pw.close();
	}
}
